
/* JavaScript content from js/cancelReq.js in folder common */


function cancelRequest(){
	alert("cancel");
	var cus_id=window.customer.id;	
	var invocationData = {
			adapter :   'stAdp',
			procedure : 'calRequest',
			parameters : [{'cus_id': cus_id}]
		};
	
	WL.Client.invokeProcedure(invocationData,{
		onSuccess : cancelRequestSuccess,
		onFailure : cancelRequestFailure,
	});
}
function cancelRequestSuccess(result){
	alert("cancelsuc");
	//alert();
	if(result.invocationResult.status==0){
		alert("cancel success!");
		$.mobile.changePage("../view/customer-main.html");
	}else if(result.invocationResult.status==1){
		alert("a driver has accepted,please think about it");	
	}else{
		WL.Logger.error("cancel request failure");
	}
			
}

function cancelRequestFailure(result){
	
		WL.Logger.error("cancel request failure");	
}
